home *** CD-ROM | disk | FTP | other *** search
- Path: hermes.oc.com!usenet
- From: Larry Weiss <lfw@oc.com>
- Newsgroups: comp.lang.c
- Subject: Re: Watch out! C "gotcha!"
- Date: Wed, 14 Feb 1996 17:54:23 -0600
- Organization: OpenConnect Systems, Dallas, TX, USA
- Message-ID: <3122762F.6587@oc.com>
- References: <4fthhh$7th@blackice.winternet.com>
- NNTP-Posting-Host: ocs2228.oc.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win16; I)
- CC: lfw@oc.com
-
- Michael Schwarz wrote:
- >
- > Many of you may already know this, but even after ten years of coding
- > in C, this took my by surprise at first. A co-worker and I were looking
- > at some library C code where I work and we noticed that the "default"
- > clause of one of the switches was misspelled as "defalt."
- > ...
- > The thing that scares me the most about this is that either I've never before
- > made this particular mistake or for the last ten years I've been leaving
- > behind a number of ticking code bombs...
- >
- > I invite your comments on this (and your knowledge -- I'm a good C programmer
- > but I don't write compilers and I'm not fully conversant with the full
- > ANSI spec on C). Please feel free to e-mail me.
- >
-
-
- It's a good observation. I'd suggest a
-
- grep "t:" *.c | grep -v "default"
-
- or equivalent inspection of any body of C source every once in a while.
-